<link rel="stylesheet" href="__CSS__/geocaching.css">
<div class="breadcrumbs" id="breadcrumbs">
    <!--导航路径列表-->
    <ul class="breadcrumb no-margin-left">
        <li>
            <a>藏宝前台</a>
        </li>
        <li class="action">
            藏宝排行榜
        </li>
    </ul>
</div>
<div class="mbx" style="    padding-bottom: 200px;">
    <div class="widget-box transparent">
        <div class="nav-tab" style="position: relative">
            <ul class="nav-tab-title s_record-margin">
                <li class="nav-this">藏宝排行榜</li>
            </ul>
        </div>
        <div class="widget-body">
            <div class="widget-main padding-10">
                <div class="row">
                    <div class="col-xs-12">
                        <form class="form-horizontal s_input-bgcolor" method="post" action="/admin/treasure/treasureRank">
                            <div class="col-lg-3 col-md-6 col-sm-12 col-xs-12 pad-b20">
                                <div class="form-group">
                                    <label class="col-sm-4 control-label text-right no-padding-right" for="uname">用户名： </label>
                                    <div class="col-sm-8">
                                        <input type="text"  name="uname" id="uname" value="{$postArr.uname}" placeholder="请输入用户名" class="form-control">
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-12 col-xs-12 pad-b20">
                                <div class="form-group">
                                    <label class="col-sm-4 control-label text-right no-padding-right" for="tname">真实姓名： </label>

                                    <div class="col-sm-8">
                                        <input type="text"  name="tname" id="tname" value="{$postArr.tname}" placeholder="请输入真实姓名" class="form-control">
                                    </div>
                                </div>
                            </div>

                            <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12 pad-b20">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label text-right no-padding-right">时间： </label>

                                    <div class="col-sm-8">
                                        <div class="input-daterange input-group">
                                            <input type="text" class="input-sm form-control" placeholder="开始时间" name="start" id="start" value="{$postArr.start}" id="start">
                                            <span class="input-group-addon" style="background: none;border: none;">
																	-
																</span>
                                            <input type="text" class="input-sm form-control" placeholder="结束时间" name="end" id="end" value="{$postArr.end}" id="end">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 pad-b20 ">
                                <div class="form-group">
                                    <label class="col-sm-4 control-label text-right no-padding-right">排序： </label>
                                    <div class="col-sm-8">
                                        <select class="form-control back-linegtgray7" name="sort" id="sort">
                                            <option value="1" {eq name="postArr.sort" value="1"}selected{/eq}>个人藏宝从高到低</option>
                                            <option value="2" {eq name="postArr.sort" value="2"}selected{/eq}>累计业绩从高到低</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pad-b20 text-right">
                                <button class="btn" type="button" onclick="exportData()" style="width: 120px;    border-radius: 2rem; background: #37c724!important;border-color: #37c724;margin-left: 20px;">导出EXCEL</button>
                                <button class="btn" style="width: 120px;    border-radius: 2rem; background: #fba40a!important;border-color: #fba40a;margin-left: 20px;">查询</button>
                            </div>
                        </form>
                        <div class="space"></div>
                        <div class="row">
                            <div class="col-xs-12">
                                <table id="sample-table-1" class="table table-hover">
                                    <thead>
                                    <tr>
                                        <th class="center">用户名</th>
                                        <th class="center">姓名</th>
                                        <th class="center">个人藏宝</th>
                                        <th class="center">累计业绩</th>
                                        <th class="center">团队人数</th>
                                        <th class="center">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>

                                    {empty name="resList"}
                                    <tr class="s_tr-vertical">
                                        <td colspan="6" class="center" style="color: red;">没有查询到结果</td>
                                    </tr>
                                    {/empty}

                                    {volist name="resList" id="vo"}
                                    <tr class="s_tr-vertical s_tr-border s_shoplist-first">
                                        <td class="center">{$vo.uname}</td>
                                        <td class="center">{$vo.tname}</td>
                                        <td class="center">{$vo.hideamount|default='0'}</td>
                                        <td class="center">{$vo.totalamount|default='0'}</td>
                                        <td class="center">{$vo.teamnum}</td>
                                        <td class="center"><a onclick="teamUser({$vo.uid})" style="cursor: pointer">团队业绩</a></td>
                                    </tr>
                                    {/volist}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="text-center">
        {$pageShow}
    </div>
</div>
<div id="team" style="width: 100%;height: 100%;position: fixed;left: 0;top: 0;z-index: 9000000;display: none">
</div>
<script src="__JS__/laydate.js"></script>
<script>
    laydate.render({
        elem: '#start' //指定元素
    });
    laydate.render({
        elem: '#end' //指定元素
    });
    //导出数据
    function exportData(){
        var uname = $('#uname').val();
        var tname = $('#tname').val();
        var start = $('#start').val();
        var end = $('#end').val();
        var sort = $('#sort').val();
        window.open('/admin/treasure/treasureRank?export=1&uname='+uname+'&tname='+tname+'&start='+start+'&end='+end+'&sort='+sort);
    }
    //团队业绩
    function teamUser(id) {
        var html = '<span style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;background: rgba(0,0,0,0.4)"></span><iframe src="/admin/treasure/teamUser?id='+id+'"frameborder="0" style="width:1000px;height:700px;position: absolute;left: 50%;top: 50%;margin-left:-451px;margin-top:-336px;background: #fff;z-index: 1;"></iframe>';
        $('#team').html(html);
        $('#team').show();
    }
    function closeDialog() {
        $('#team').hide();
    }
</script>